//
//  BaseModel.m
//  ProjectOfBStage
//
//  Created by cuixin on 15/11/11.
//  Copyright © 2015年 cuixin. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

-(instancetype)initWithDictionary:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+(instancetype)modelWithDictionary:(NSDictionary *)dic{
    
    return  [[[self alloc]initWithDictionary:dic] autorelease];
}


-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"id"]) {
        self.ID = [NSString stringWithFormat:@"%@", value] ;
    }
}

@end
